<?php
/**
 * Author: Administrator
 * Date: 2022/8/3 2:12
 */

namespace DesignPatterns\Behavioral\TemplateMethod;

abstract class Journey
{
    final public function takeATrip(): void
    {
        $this->buyAFlight();
        $this->takePlane();
        $this->enjoyVocation();
        $this->buyGifts();
        $this->takePlane();
    }

    abstract public function enjoyVocation();

    final public function takePlane(): void
    {
        echo 'Take the plane';
    }

    private function buyAFlight(): void
    {
        echo 'Bying a flight';
    }

    protected function buyGifts(): void
    {}

}